package com.ys.web.yinsheng.service;

import com.ys.utils.datasource.DataSourceBy;
import com.ys.web.yinsheng.mapper.YinShengMapper;
import com.ys.web.yinsheng.model.UserMerchant;
import com.ys.web.yinsheng.model.YinShengMerchantInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @Author: dhf
 * @ClassName: YinShengServer
 * @Date: 2022/7/21 14:36
 * @Description:
 * @Version: 1.0
 */
@Service
public class YinShengService {
    @Autowired
    private YinShengMapper yinShengMapper;

    @DataSourceBy("ysIm")
    public int insert(YinShengMerchantInfo yinShengMerchantInfo) {
        return yinShengMapper.insert(yinShengMerchantInfo);
    }

    /**
     * @作者: dhf
     * @名称:查询用户银盛信息
     * @param uid
     * @时间: 2022/7/22 8:35
     * @备注:
     * @返回值: com.ys.web.yinsheng.model.UserMerchant
     */
    @DataSourceBy("ysIm")
    public UserMerchant userMerchant(String uid){
        return yinShengMapper.userMerchant(uid);
    }

    /**
     * @作者: dhf
     * @名称: 收取手续费账户
     * @param
     * @时间: 2022/8/15 9:29
     * @备注:
     * @返回值: java.util.Map<java.lang.String, java.lang.Object>
     */
    @DataSourceBy("ysIm")
    public Map<String,Object> collectionUser() {
        return yinShengMapper.collectionUser();
    }
    /**
     * @作者: dhf
     * @名称: 添加手续费账户累计资金
     * @param uid
     * @param fee
     * @时间: 2022/8/15 9:29
     * @备注:
     * @返回值: int
     */
    @DataSourceBy("ysIm")
    public int collectionUserMoney(long uid, Long fee) {
        return yinShengMapper.collectionUserMoney(uid,fee);
    }


    @DataSourceBy("ysIm")
    public int getUserBankCount(Long userId){
        return yinShengMapper.getUserBankCount(userId);
    }
}
